// 
import {request, uploadFile} from './bks.request'

// 小程序-我的
export const userInfo = () => {
  return request({
    url: '/applet/member/mine'
  })
}
// 小程序-标签列表
export const memberTags = () => {
  return request({
    url: '/applet/member/tag'
  })
}
// 上传头像
export const uploadAvatar = (file) => {
  return uploadFile({
    url: '/applet/school/backend/upload',
    name: 'file',
    file
  })
}
//校验图片是否违规
export const uploadAvatarCheck = (file) => {
  return uploadFile({
    url: '/applet/applet-anon/live/applet-anon/check',
    name: 'file',
    file
  })
}

// 小程序-我的信息详情
export const infoDetail = () => {
  return request({
    url: '/applet/member/mine/detail'
  })
}
export const infoEdit = (data) => {
  return request({
    url: '/applet/member/info',
    method: 'put',
    data
  })
}
// 退出登录
export const loginOut = () => {
  return request({
    url: '/oauth/signOut',
    method: 'delete'
  })
}
// 收藏的院校
export const schoolCollect = (params) => {
  return request({
    url: '/applet/collect/school',
    params
  })
}
// 收藏的专业
export const majorCollect = (params) => {
  return request({
    url: '/applet/major/collect',
    params
  })
}
// 收藏课程
export const courseCollect = (params) => {
  return request({
    url: '/applet/member/concern/course',
    params
  })
}
// 收藏的资料列表
export const materialsCollect = (params) => {
  return request({
    url: '/applet/materials/app/collect',
    params
  })
}
// 我的收藏-咨询
export const consultCollect = (params) => {
  return request({
    url: '/applet/collect/consult',
    params
  })
}

// 小程序用户开通vip会员详情
export const vipDetail = () => {
  return request({
    url: '/applet/bksOrder/applet-anon/select',
    method: 'post'
  })
}
// 小程序用户开通vip会员详情
export const vipListDetail = () => {
  return request({
    url: '/applet/bksOrder/applet-anon/vip/list',
    method: 'post'
  })
}

export const orderPay = (params) => {
  return request({
    url: '/applet/bksOrder/opening',
    method: 'post',
    params
  })
}
// 我的课程列表
export const courseList = (data) => {
  return request({
    url: '/applet/course/list',
    method: 'post',
    data
  })
}
// 适用年纪下拉框
export const gradeSelect = () => {
  return request({
    url: '/applet/course/grade/list'
  })
}
// 适用科目下拉框
export const subjectSelect = () => {
  return request({
    url: '/applet/course/subject/list'
  })
}
// 课程详情
export const courseDetail = (params) => {
  return request({
    url: '/applet/course/info',
    params
  })
}
// 保存课程
export const courseAdd = (data) => {
  return request({
    url: '/applet/course/save',
    method: 'post',
    data
  })
}
// 修改课程
export const courseEdit = (data) => {
  return request({
    url: '/applet/course/modify',
    method: 'post',
    data
  })
}
// 删除课程
export const courseDel = (params) => {
  return request({
    url: '/applet/course/del',
    params
  })
}
// 我的课时列表
export const periodList = (params) => {
  return request({
    url: '/applet/period/list',
    params
  })
}
// 排序传 主键id
export const periodSort = (data) => {
  return request({
    url: '/applet/period/sort',
    method: 'post',
    data
  })
}
// 课时详情
export const periodDetail = (params) => {
  return request({
    url: '/applet/period/info',
    params
  })
}
// 保存课时
export const periodAdd = (data) => {
  return request({
    url: '/applet/period/save',
    method: 'post',
    data
  })
}
// 修改课时
export const periodEdit = (data) => {
  return request({
    url: '/applet/period/modify',
    method: 'post',
    data
  })
}
// 删除课时
export const periodDel = (params) => {
  return request({
    url: '/applet/period/del',
    method: 'get',
    params
  })
}
// 预告改录播
export const videoAdd = (params) => {
  return request({
    url: '/applet/period/modify/lb',
    params
  })
}
// 主播信息
export const anchorDetail = () => {
  return request({
    url: '/applet/anchor/info'
  })
}
// 当前登录用户是否是主播 state: 0 待审核 1 审核通过 2 拒绝通过 3 封禁 msg:审核不通过原因，封禁原因
export const anchorState = () => {
  return request({
    url: '/applet/anchor/state'
  })
}
// 申请主播
export const anchorAdd = (data) => {
  return request({
    url: '/applet/anchor/add',
    method: 'post',
    data
  })
}
// 新增临时素材(素材类型：image)
export const uploadMediaImg = (file) => {
  return uploadFile({
    url: '/applet/applet-anon/live/media?mediaType=image',
    name: 'file',
    file
  })
}
// 创建直播间
export const liveAdd = (data) => {
  return request({
    url: '/applet/applet-anon/live/creat/room',
    method: 'post',
    data
  })
}
// 我的课程
export const buyCourseList = (params) => {
  return request({
    url: '/applet/member/concern/buy/course',
    params
  })
}
// 我的咨询
// export const myConsultList = (params) => {
//   return request({
//     url: '/applet/member/concern/consult',
//     params
//   })
// }
// 我的咨询
export const myConsultList = (params) => {
  return request({
    url: '/applet/expert/consult/user',
    params
  })
}
// 专家咨询
export const expertConsultList = (params) => {
  return request({
    url: '/applet/expert/consult',
    params
  })
}



// 关注我的
export const myFansList = (params) => {
  return request({
    url: '/applet/member/concern/to/my',
    params
  })
}
// 我关注的
export const myFollowList = (params) => {
  return request({
    url: '/applet/member/concern/my',
    params
  })
}
// 我的回答
export const myAnswerList = (params) => {
  return request({
    url: '/applet/member/concern/answer',
    params
  })
}
// 查询用户详细设置
export const remindDetail = () => {
  return request({
    url: '/applet/remind/details'
  })
}
// 修改用户详细设置
export const remindEdit = (data) => {
  return request({
    url: '/applet/remind/details',
    method: 'put',
    data
  })
}
// 添加反馈
export const feedbackAdd = (data) => {
  return request({
    url: '/applet/feedback/add',
    method: 'post',
    data
  })
}
// 添加举报
export const reportAdd = (data) => {
  return request({
    url: '/applet/report/add',
    method: 'post',
    data
  })
}
// 获取登录用户未读的消息总数
export const notifyTotal = () => {
  return request({
    url: '/notify/total'
  })
}
// 我的通知列表
export const notifyList = (data) => {
  return request({
    url: '/notify/list',
    method: 'post',
    data
  })
}
// 用户读消息
export const notifyRead = (params) => {
  return request({
    url: '/notify/read',
    params
  })
}
// 已读全部消息
export const notifyReadAll = () => {
  return request({
    url: '/notify/read/all'
  })
}
// 消息中心跳转咨询/回复 前检验 咨询/回复 是否被删除
export const jumpCheck = (params) => {
  return request({
    url: '/applet/consult/jump/check',
    params
  })
}
// 课程订单
export const orderCourseList = (data) => {
  return request({
    url: '/applet/bksOrder/mine/order',
    method: 'post',
    data
  })
}
// 工作月份时间设置查询
export const workQuery = (params) => {
  return request({
    url: '/applet/export/work/query',
    method: 'get',
    params
  })
}
// 工作与工作时间开关设置
export const workEdit = (params) => {
  return request({
    url: '/applet/export/work/update',
    method: 'get',
    params
  })
}
// 工作日详情查询
export const workDayQuery = (params) => {
  return request({
    url: '/applet/export/work/day/query',
    method: 'get',
    params
  })
}

// 工作日详情设置
export const workDayEdit = (data) => {
  return request({
    url: '/applet/export/work/day/set',
    method: 'post',
    data
  })
}

// 获取服务器时间戳
export const nowDate = (params) => {
  return request({
    url: '/applet/score/applet-anon/get/now/date',
    method: 'get',
    params
  })
}

